package com.learnyou.server.xingzuo.biz.common;

import com.learnyou.server.xingzuo.dto.wechat.WechatThirdAuthorizerTokenResultDTO;
import com.learnyou.server.xingzuo.dto.wechat.WechatThirdTokenDataDTO;
import com.learnyou.server.xingzuo.dto.wechat.WechatTokenDataDTO;

public enum CacheTokenEnum {
    /**
     * 小程序token
     */
    MINI_APP_TOKEN("token", XingzuoConstants.MINI_APP_TOKEN, "getAccess_token", WechatTokenDataDTO.class),

    /**
     * 开放平台token
     */
    THIRD_TOKEN("third_token", XingzuoConstants.THIRD_TOKEN, "getComponent_access_token", WechatThirdTokenDataDTO.class),

    /**
     * 授权者token
     */
    THIRD_AUTHORIZER_TOKEN("authorizer_token", "$APPID", "getAuthorizer_access_token", WechatThirdAuthorizerTokenResultDTO.class),

    ;
    private String tokenType;
    private String cacheKey;
    private String tokenMethodName;
    private Class clazz;

    CacheTokenEnum(String tokenType, String cacheKey, String tokenMethod, Class clazz) {
        this.tokenType = tokenType;
        this.cacheKey = cacheKey;
        this.tokenMethodName = tokenMethod;
        this.clazz = clazz;
    }


    public String getTokenType() {
        return tokenType;
    }

    public void setTokenType(String tokenType) {
        this.tokenType = tokenType;
    }

    public String getCacheKey() {
        return cacheKey;
    }

    public void setCacheKey(String cacheKey) {
        this.cacheKey = cacheKey;
    }

    public Class getClazz() {
        return clazz;
    }

    public void setClazz(Class clazz) {
        this.clazz = clazz;
    }

    public String getTokenMethodName() {
        return tokenMethodName;
    }

    public void setTokenMethodName(String tokenMethodName) {
        this.tokenMethodName = tokenMethodName;
    }
}
